Cybersecurity Attacks – Red Team Strategies by Johann Rehberger
Author:Johann Rehberger
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2020-03-30T00:00:00+00:00
Figure 6.27: Loading CSV files into the graph database
Here we see the successful load of a CSV file so that it can be processed by Neo4j. However, at this point, we have not yet created nodes in the graph database. Let's look at how to do that.
Loading CSV data and creating nodes and relationships
The following Cypher statement shows how to successfully load the machines.csv file into the graph database, create nodes for services and computer, and create relationships between these nodes:
LOAD CSV WITH HEADERS FROM "file:///machines.csv" AS line
FIELDTERMINATOR ';'
MERGE (s:Services {port: line.PORT, service: line.SERVICE, hostname: line.FQDN})
MERGE (c:Computer {hostname: line.FQDN, ip: line.IP, operatingsystem: line.OS})
MERGE (c)-[e:EXPOSES]->(s)
Afterward, we can query the graph using this:
MATCH graph=(c:Computer)-[]-(s:Services) RETURN services
This will show the computer nodes and what services each node exposes:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Grails in Action by Glen Smith Peter Ledbrook(9163)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(8808)
Azure Containers Explained by Wesley Haakman & Richard Hooper(7442)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(7432)
Kotlin in Action by Dmitry Jemerov(7263)
Running Windows Containers on AWS by Marcio Morales(6982)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5400)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(5209)
Combating Crime on the Dark Web by Nearchos Nearchou(4979)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4667)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4527)
Python for Security and Networking - Third Edition by José Manuel Ortega(4233)
The Age of Surveillance Capitalism by Shoshana Zuboff(4209)
Learn Wireshark by Lisa Bock(4116)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3886)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3681)
DevSecOps in Practice with VMware Tanzu by Parth Pandit & Robert Hardt(3568)
Windows Ransomware Detection and Protection by Marius Sandbu(3540)
Blockchain Basics by Daniel Drescher(3507)